<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>申请书规则对比结果</title>
<%@ include file="/common/meta.jsp"%>
</head>
<body>
	<div style="width:790px" id="contentDiv">
		<c:set var="encPrpCode"><iris:des3 code="${simplePrpInfo.PRP_CODE}" /></c:set>
		<!-- <div class="t_bar">项目简要信息</div> -->
		<table id="tblSimplePrpInfo" class="t_css" border="0" cellpadding="0" cellspacing="1" style="width:100%">
			<col style="width:10%"/>
			<col style="width:40%"/>
			<col style="width:10%"/>
			<col style="width:40%"/>
			<tr class="t_tr">
				<td colspan="4">项目简要信息</td>
			</tr>
			<tr class="li_1">
				<td align="right">年度：</td>
				<td>&nbsp;${simplePrpInfo.STAT_YEAR}</td>
				<td align="right">项目类别：</td>
				<td>&nbsp;${simplePrpInfo.GRANT_NAME}</td>
			</tr>
			<tr class="li_2">
				<td align="right">项目名称：</td>
				<td>&nbsp;${simplePrpInfo.ZH_TITLE}</td>
				<td align="right">申请单位：</td>
				<td>&nbsp;${simplePrpInfo.ORG_NAME}</td>
			</tr>
		</table>
		<div class="clear_h15"></div>
		
		<div>
			<div id='TopBarMnt' style="display:none"></div>
			<table id='dataGrid'></table>
			<div id='dataBar' style="display:none"></div>
		</div>
		
		<div class="clear_h10"></div>
		<div style="text-align: center;">
      		&nbsp;<input type="button" class="button_01" value="关闭" onclick="parent.tb_remove();" id="back"/>
	  	</div>
	</div>

	<script type="text/javascript">
		var prcWin = new progressWin("${res}");//初始化遮罩层
		var irisGrid = new IrisGrid("dataGrid", "dataBar", 'TopBarMnt');
		
		function buildGrid() {
			var columnAttrList = new Array();
			columnAttr = new ColumnAttr("规则名称", "rule_name", "rule_name", 2,
					"left", true);//表头，字段名，，，宽度比例，居左，是否需要表头排序
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("规则条件", "rule_desc", "rule_desc", 4,
					"left", true);//表头，字段名，，，宽度比例，居左，是否需要表头排序
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("规则类型", "vallidate_type", "vallidate_type", 2,
					"center", true);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("参考值", "expect_value", "expect_value", 4,
					"center", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("实际值", "essence_value", "essence_value", 4,
					"center", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("校验结果", "check_result", "check_result", 2,
					"center", true);
			columnAttrList.push(columnAttr);
			<c:if test="${empty param.actionFlag}">
			columnAttr = new ColumnAttr("操作", "操作", "操作", 1,
					"center", false);
			columnAttrList.push(columnAttr);
			</c:if>
			irisGrid.setColumnAttrs(columnAttrList);
			
			irisGrid
					.setUrl("${ctx}/prpapprove/prp-check-result?flag=grid&viewFlag=${param.flag}&prpCode="+encodeURIComponent('${encPrpCode}'));//查询url
			irisGrid.setCaption("暂写");
			irisGrid.setDefaultSortName("");//默认排序字段
			irisGrid.setDefaultSortorder("");
			irisGrid.setWidth(787);//整个表格宽度
			irisGrid.setCheckAble(false);//表格左边是否要复选框
			irisGrid.setRowNum(999);//控制一页显示多少行
			irisGrid.setShowRowIndex(false);//是否显示行号
			//irisGrid.setQueryBox('searchBt', 'prpApprove_search');//查询条件 按钮名，查询条件function_key
			irisGrid.setLoadComplete(adjustCss);
			irisGrid.build();
		}
		jQuery(function() {

			buildGrid();
		});
		/** 表格初始化**/
		
		function adjustCss(){
			//ui-jqgrid-view
			//dataBar
			$(".ui-jqgrid-htable thead tr").css("height","30px");
			//$("#TopBarMnt").css("display","none");
			//$("#dataBar").css("display","none");
		}
		
		
	
		function showKeyPrps(key_codes){
			tb_show("项目列表","${ctx}/prpapprove/check-result-prp?prpCodes=" + key_codes
					+ "&TB_iframe=true&height=400&width=600", false);
		}
		
		function showOrgCredit(key_codes){
			tb_show("企业信用","${ctx}/blacklist/view-check-result-org?flag=init&blackIds=" + key_codes
					+ "&TB_iframe=true&height=150&width=800", false);
		}
		
		function showPsnCredit(key_codes){
			tb_show("个人信用","${ctx}/blacklist/view-check-result-psn?flag=init&blackIds=" + key_codes
					+ "&TB_iframe=true&height=150&width=800", false);
		}
		
		//规则确认：不输入规则检查意见（已不用）
		function setFitStatus(prpCode,ruleCode,status){
			prcWin.openWin();// 打开遮罩层
			
			var post_data = {
					"prpCode":prpCode,
					"ruleCode" : ruleCode,
					"status":status
				};
			
			var options = {
				url : '${ctx}/prpapprove/set-fit-status',
				type : 'post',
				dataType:'text',
				data : post_data,
				beforeSend : function() {
				}, // 表单提交前的回调函数
				success : function(data) { 
					if (data == 'success') {
						prcWin.closeWin();// 关闭遮罩层
						scmSuccess("操作成功！");
						irisGrid.getGridDom().jqGrid("refresh", 0);// 0是本页1是首页
						parent.irisGrid.getGridDom().jqGrid("refresh", 0);// 0是本页1是首页
					} else {
						prcWin.closeWin();// 关闭遮罩层
						scmError("操作失败！");
					}
				},
					error:function(){
						prcWin.closeWin();// 关闭遮罩层
						scmError("操作失败！");
				}
			}
			$.ajax(options);
		}
		
		//规则确认：可以输入规则检查意见
		function setFitStatus2(prpCode,ruleCode){
			tb_show("规则检查审核","${ctx}/prpapprove/prp-check-confirm?ruleCode="
					+ruleCode+"&prpCode="+encodeURIComponent(prpCode)+"&TB_iframe=true&height=300&width=600", false);
		}
		
	</script>
</body>
</html>